//
//  YSVideoCollectionCell.m
//  Yueshi
//
//  Created by yueshi－mac1 on 16/1/11.
//  Copyright © 2016年 悦食中国. All rights reserved.
//

#import "YSVideoCollectionCell.h"
#import "UIImageView+VideoImage.h"

@interface YSVideoCollectionCell()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconView;

@end

@implementation YSVideoCollectionCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *CellIdentiferId = @"YSVideoCollectionCell";
    YSVideoCollectionCell *cell =  [tableView dequeueReusableCellWithIdentifier:CellIdentiferId];
    if(cell == nil){
        NSArray *nibs = [[NSBundle mainBundle]loadNibNamed:@"YSVideoCollectionCell" owner:nil options:nil];
        cell = [nibs lastObject];
    }
    return cell;
}

-(void)setAdvert:(YSAdvert *)advert{
    [self.nameLabel setText:advert.advertTitle];
    [self.iconView setImageWithVideoUrl:advert.advertVideoUrl];
}

@end
